package com.eDrive;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.Toast;

public class StatOverview extends Activity {
	private String fileName;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.statoverview);
		Bundle extras = getIntent().getExtras();
		if (extras == null || extras.getString("fileName") == null || extras.getString("fileName") == "") {
			Toast.makeText(getApplicationContext(), "Something went wrong. Please try again.", 5).show();
			finish();
		}
		fileName = extras.getString("fileName");
	}
	
	public void startStatView(View v) {
		Intent myIntent = new Intent(v.getContext(), Statview.class);
		myIntent.putExtra("fileName", fileName);
		startActivityForResult(myIntent, 10);
	}
	
	public void startChartView(View v) {
		Intent myIntent = new Intent(v.getContext(), ChartView.class);
		myIntent.putExtra("fileName", fileName);
		startActivityForResult(myIntent, 0);
	}
	
	public void startMapView(View v) {
		Intent myIntent = new Intent(v.getContext(), MapViewer.class);
		myIntent.putExtra("fileName", fileName);
		startActivityForResult(myIntent, 0);
	}
	
}